﻿Public Class AdditionalParameter

    Private dtAddParam As New DataTable("Additionalarameters")

    Public Sub New()
        Dim cName As New DataColumn("Name", System.Type.GetType("System.String"))
        Dim cOptional As New DataColumn("Optional", System.Type.GetType("System.Boolean"))
        cOptional.ReadOnly = True
        Dim cValue As New DataColumn("Value", System.Type.GetType("System.String"))
        dtAddParam.Columns.Add(cName)
        dtAddParam.Columns.Add(cOptional)
        dtAddParam.Columns.Add(cValue)
    End Sub

    Public Sub Add(ByVal Name As String)
        Dim r As DataRow = dtAddParam.NewRow()
        r("Name") = Name
        r("Optional") = True
        r("Value") = ""
        dtAddParam.Rows.Add(r)
    End Sub

    Public Sub Add(ByVal Name As String, ByVal [Optional] As Boolean)
        Dim r As DataRow = dtAddParam.NewRow()
        r("Name") = Name
        r("Optional") = [Optional]
        r("Value") = ""
        dtAddParam.Rows.Add(r)
    End Sub

    Public Sub Add(ByVal Name As String, ByVal [Optional] As Boolean, ByVal [Value] As String)
        Dim r As DataRow = dtAddParam.NewRow()
        r("Name") = Name
        r("Optional") = [Optional]
        r("Value") = [Value]
        dtAddParam.Rows.Add(r)
    End Sub

    Public Function [Get]() As DataTable
        Return dtAddParam
    End Function

End Class
